﻿using Orchard.Localization;
using Orchard.Security;
using Orchard.UI.Navigation;

namespace Amba.DownloadsCounter
{
    public class AdminMenu : INavigationProvider
    {
        public Localizer T { get; set; }
        public string MenuName { get { return "admin"; } }

        public void GetNavigation(NavigationBuilder builder)
        {
            builder.AddImageSet("downloadcounter")
                .Add(T("Downloads Count"), "3",
                     menu => menu.Add(T("By Filename"), "1.0",
                                      qi => qi
                                        .Action("ByFile", "Admin", new {area = "Amba.DownloadsCounter"})
                                        .LocalNav())
                                 .Add(T("Last 100 downloads"), "2.0",
                                      qi => qi
                                        .Action("Last100", "Admin", new { area = "Amba.DownloadsCounter" })
                                        .LocalNav())
                );

        }
    }
}
